package cn.openea.perpartner.crm.web.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * (CrmUser)表实体类
 *
 * @author Weird077
 * @since 2022-12-19 22:30:29
 */
@Data
@SuppressWarnings("serial")
public class CrmUser implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId
    private String userId;

    private String status;

    private String userName;

    private String sex;

    private String phone;

    private String email;
    //年龄层
    private String ageGroup;

    private String province;

    private String city;
    //最⾼学历
    private String degree;
    //身份职业
    private String identity;
    //工作年限
    private String workYears;
    //⾏业/岗位/⼯作经验
    private String experience;
    //技能
    private String skills;
    //爱好
    private String hobby;
    //简历附件
    private String cvFile;

    private String hrId;

    private String hrName;

    private String createTime;

    private String updateTime;
    //任职岗位
    private String position;
    //入职日期
    private String entryDate;
    //注册码Url
    private String codeUrl;
    //注册码（有效期
    private String codeExpirationDate;
    /** 角色对象 */

    @TableField(exist = false)
    private List<CrmRole> roles;
    /** 角色组 */
    @TableField(exist = false)

    private Long[] roleIds;
    /** 角色ID */
    @TableField(exist = false)

    private Long roleId;

    public boolean isAdmin()
    {
        return isAdmin(this.userId);
    }
    public static boolean isAdmin(String userId) {
        return "admin".equals(userId);
    }
}

